![]() |
PATH![]() |
Information about an opened interface or pipe is contained within the interface and pipe descriptors, and other descriptors associated with them.
You use the USBFindNextAssociatedDescriptor function to find a specific interface or pipe descriptor, or any descriptor associated with the interface or endpoint. For example, a HID interface driver could use this function to find HID descriptors.
OSStatus USBFindNextAssociatedDescriptor(USBPB *pb);
Required fields required the USBPB parameter block for the USBFindNextAssociatedDescriptor function are
The USBFindNextAssociatedDescriptor function steps through the descriptors following the relevant interface or endpoint descriptor, and returns the descriptors matching the given parameters. If usbReference is an interface reference, all the descriptors are returned until the next interface descriptor is found, or until the end of the configuration descriptor is reached. If usbReference is a pipe reference, all of the descriptors are returned until the next endpoint or interface descriptor is found, or until the end of the configuration descriptor is reached.
The usbWIndex field provides an index into all the available descriptors. A value of 1 describes the interface or endpoint descriptor itself, so passing 0 allows the interface or endpoint descriptor to be returned. If usbWIndex is passed back in the next call untouched, the function returns the next available matching descriptor.
The usbOther field contains a descriptor type to match. If searching for any type ( usbOther set to 0) all descriptors are matched. To use this method of search again for all descriptors, the usbOther field has to be set to 0 each time the function is called.
The errors returned by the USBFindNextAssociatedDescriptor function include:
The USBDisposeInterfaceRef function closes the specified interface currently opened. The interface reference obtained with the USBNewInterfaceRef function for this interface is no longer valid after the call USBDisposeInterfaceRef call completes.
OSStatus USBDisposeInterfaceRef(USBPS *pb);
Required fields in the USBPB parameter block for the USBDisposeInterfaceRef function are
If the usbCompletion field is set to kUSBNoCallBack, the call back mechanism is not invoked. This is useful for finalization routines which need to clean up immediately and can't wait for a callback routine to complete.
If the no call back option ( kUSBNoCallBack ) is used, the parameter block is free as soon as the USBDisposeInterfaceRef call returns.
Errors returned by the USBDisposeInterfaceRef function include
kUSBUnknownInterfaceErr
|
-6978 | usbReference does not refer to a current interface |
Previous | Back Up One Level | Next |